﻿
using DataService.Common;
using DataService.Core.ServiceDTO;
using System;
using System.Collections.Generic;
using System.Data.Common;
using System.Text;

namespace DataService.DataAccessLayer
{
    public class OracleProvider: DatabaseProvider
    {
        public override DatabaseType DBType => DatabaseType.Oracle;
        public override Type DatabaseProviderType => typeof(OracleProvider);
        private static DbProviderFactory _Factory;
        /// <summary>工厂</summary>
        public override DbProviderFactory ProviderFactory
        {
            get
            {
                if (_Factory == null)
                {
                    //lock (typeof(OracleProvider))
                    //{
                    //    // Microsoft 是最新的跨平台版本，优先使用
                    //    //if (_Factory == null) _Factory = GetProviderFactory("Microsoft.Data.SqlClient.dll", "Microsoft.Data.SqlClient.SqlClientFactory", false, true);
                    //    if (_Factory == null) _Factory = GetProviderFactory(string.Empty, "Microsoft.Data.SqlClient.SqlClientFactory", false, true);
                    //    if (_Factory == null) _Factory = GetProviderFactory("System.Data.SqlClient.dll", "System.Data.SqlClient.SqlClientFactory");
                    //}
                }

                return _Factory;
            }
        }

    }
}
